import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '@/views/Home/index.vue'
import Login from '@/views/Login/index.vue'
import Register from '@/views/Register/index.vue'
import User from '@/views/Home/components/user.vue'
import Data from '@/views/Home/components/data.vue'
import Goods from '@/views/Home/components/goods.vue'
import Personalcenter from '@/views/Home/components/personalcenter.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Login
  },
  {
    path: '/home',
    component: Home,
    children:[
      {
        path: "",
        component: Data
      },
      {
        path: "goods",
        component: Goods
      },
      {
        path: "user",
        component: User
      },
      {
        path:"personalcenter",
        component: Personalcenter
      }
    ]
  },
  {
    path: '/register',
    component:Register
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
